package com.oppo.action;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oppo.tools.MyTools;

@WebServlet("/ExitControl")
public class ExitControl extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		String user_id = request.getSession().getAttribute("user_id").toString();
		MyTools.logRootLogger.info(user_id + "注销登录！");
		MyTools.logRootLogger.info("时间：" + MyTools.dateToString(new Date(), "yyyy-MM-dd HH:mm:ss"));
		request.getSession().setAttribute("user_id", "");
		request.getRequestDispatcher("index.jsp").forward(request, response);
	}

}
